package com.gitlab.lucky.weixin.model;

import com.thoughtworks.xstream.XStream;
import java.util.List;

/**
 * @program: lucky
 * @author: Mr.Han
 * @create: 2018-11-05 15:34
 **/
public class ReplyNewsMsg extends ReplyBaseMsg {
    private Integer ArticleCount;
    private List<Article> Articles;

    public Integer getArticleCount() {
        return ArticleCount;
    }

    public void setArticleCount(Integer articleCount) {
        ArticleCount = articleCount;
    }

    public List<Article> getArticles() {
        return Articles;
    }

    public void setArticles(List<Article> articles) {
        Articles = articles;
    }

    /**
     * 将对象转换为XML
     * @return
     */
    public String News2XML(){
        XStream xstream=new XStream();
        xstream.alias("xml", this.getClass());
        for(Article article:Articles){
            xstream.alias("item", article.getClass());
        }
        return xstream.toXML(this);
    }
}
